package com.nova.android.tvlauncher.ui.dialog.ext

import android.view.View
import com.nova.android.tvlauncher.ui.dialog.HomeMenuPop
import com.nova.android.tvlauncher.ui.dialog.base.getPop
import com.codeZeng.lib_dimen.R
import com_github_lib_base.currentActivity
import com_github_lib_base.ext.dimenValue

fun View.showHomeMenuDialog(setup: (HomeMenuPop.() -> Unit)? = null) =
    getPop<HomeMenuPop>(currentActivity?.let {
        HomeMenuPop.Companion.newInstance(it) {
            setup?.invoke(
                this
            )
        }
    }) {
        isDestroyOnDismiss(true)
        offsetY(R.dimen.qb_px_15.dimenValue())
        atView(this@showHomeMenuDialog)
    }